<?php
require_once("vcl/vcl.inc.php");
require_once("lib/db_connection.php");
//Includes
use_unit("forms.inc.php");
use_unit("extctrls.inc.php");
use_unit("stdctrls.inc.php");

//Class definition
class personnel_delete2 extends Page
{
       public $hiddenEmp = null;
       function personnel_delete2Create($sender, $params)
       {
       $emp = $_GET['emp'];
       $this->hiddenEmp->setValue($emp);

       $result = mysql_query("delete from employee_tbl where autoid='".$this->hiddenEmp->getValue()."'");

       $result_drive = mysql_query("delete from emp_drivinghistory_tbl where emp_id='".$this->hiddenEmp->getValue()."'");

       $result_license = mysql_query("delete from emp_license_tbl where emp_id='".$this->hiddenEmp->getValue()."'");

       $result_cert = mysql_query("delete from emp_certification_tbl where emp_id='".$this->hiddenEmp->getValue()."'");

       echo "<script type=text/javascript>
        window.opener.location.reload();
        window.close();
        </script>";
       //redirect('personnel_list.php?emp='.$this->hiddenEmp->getValue());


       }

}

global $application;

global $personnel_delete2;

//Creates the form
$personnel_delete2=new personnel_delete2($application);

//Read from resource file
$personnel_delete2->loadResource(__FILE__);

//Shows the form
$personnel_delete2->show();

?>